home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-14 | 879 b | 48 lines | [TEXT/MPS ] |
- // IOStreams Package
- // Steve Teale April 1992
- // Copyright Symantec Corp 1990-1992. All Rights Reserved.
- //
- // Some portions Copyright © 1994 Apple Computer Inc.
-
- #ifndef __STDIOSTR__
- #define __STDIOSTR__
-
- #include <stdio.h>
- #include <iostream.h>
-
- class stdiobuf : public streambuf {
- public:
- stdiobuf(FILE*);
- FILE* stdiofile() { return fp; }
- ~stdiobuf();
-
- int underflow();
- #if __ZTC__ > 0x214
- int overflow(int=EOF);
- #else
- int overflow(int);
- #endif
- int pbackfail(int);
-
- private:
- FILE* fp;
- char *gptr_;
- char *egptr_;
- // Save old gptr() & egptr() while using the
- // pushback buffer.
- char pushback_buf[4];
- int fillbuf();
- };
-
- class stdiostream : public ios {
- public:
- stdiostream(FILE*);
- ~stdiostream();
- stdiobuf* rdbuf() { return &buffer; }
-
- private:
- stdiobuf buffer;
- };
-
- #endif
-